package com.ssm.service;

import com.hqj.ReturnUtil;
import com.ssm.dao.DownDao;
import com.ssm.entity.Down;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DownServiceI implements BaseService<Down> {
    @Autowired
    private DownDao dd;

    public Down get(Down down) {
        List<Down> list = dd.find(down);
        return list.size()>0?list.get(0):new Down();
    }

    public List<Down> find(Down down) {
        List<Down> list = dd.find(down);
        return list;
    }

    public Map<String, Object> add(Down down) {
        int i = dd.add(down);
        return ReturnUtil.returnMap(i>0,"保存");
    }

    public Map<String, Object> edit(Down down) {
        return null;
    }

    public Map<String, Object> remove(Down down) {
        return null;
    }
}
